#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define BIG_INT_SIZE 1000

#define MAX(a, b) ((a) > (b) ? (a) : (b))

typedef struct {
    int a[BIG_INT_SIZE];
} BigInt;

void shift(BigInt *bi) {
    for (int i = 0; i < BIG_INT_SIZE - 1; i++) {
        while (bi->a[i] < 0) {
            bi->a[i + 1] -= 1;
            bi->a[i] += 10;
        }
        bi->a[i + 1] += bi->a[i] / 10;
        bi->a[i] %= 10;
    }
}

BigInt mul(BigInt bi, int val) {
    for (int i = 0; i < BIG_INT_SIZE; i++) {
        bi.a[i] *= val;
    }
    shift(&bi);
    return bi;
}

BigInt create_big_int(int val) {
    BigInt bi;
    memset(bi.a, 0, sizeof(bi.a));
    bi.a[0] = val;
    shift(&bi);
    return bi;
}

BigInt sub(BigInt a, BigInt b) {
    for (int i = 0; i < BIG_INT_SIZE; i++) {
        a.a[i] -= b.a[i];
    }
    shift(&a);
    return a;
}

void print_big_int(BigInt a) {
    int top = BIG_INT_SIZE - 1;
    while (a.a[top] == 0 && top >= 0) {
        --top;
    }
    top = MAX(0, top);
    for (int i = top; i >= 0; i--) {
        printf("%d", a.a[i]);
    }
    printf("\n");
}

int main() {
    BigInt a[310];
    int n;
    scanf("%d", &n);
    a[0] = create_big_int(0);
    a[1] = create_big_int(1);
    for (int i = 2; i <= n; i++) {
        a[i] = sub(
                sub(
                        mul(a[i - 1], 34),
                        a[i - 2]),
                create_big_int(-2));
    }
    print_big_int(a[n]);
    return 0;
}
